/**
 * 
 */
package edu.ust.seis610.function;

/**
 * @author meeusen
 *
 */
public enum TreeElement 
{ 
	;
	
	public enum Operand 
	{
		ZERO  	{  public double eval(){ return 0.0; } public String toString(){return "0.0";}},
		ONE  	{  public double eval(){ return 1.0; } public String toString(){return "1.0";}},
		TWO  	{  public double eval(){ return 2.0; } public String toString(){return "2.0";}},
		THREE  	{  public double eval(){ return 3.0; } public String toString(){return "3.0";}},
		FOUR  	{  public double eval(){ return 4.0; } public String toString(){return "4.0";}},
		FIVE  	{  public double eval(){ return 5.0; } public String toString(){return "5.0";}},
		SIX  	{  public double eval(){ return 6.0; } public String toString(){return "6.0";}},
		SEVEN  	{  public double eval(){ return 7.0; } public String toString(){return "7.0";}},
		EIGHT  	{  public double eval(){ return 8.0; } public String toString(){return "8.0";}},
		NINE  	{  public double eval(){ return 9.0; } public String toString(){return "9.0";}},
		//this isn't the best idea, however primitive types can't be null so i'll set -1 as a flag to mean X.
		X  		{  public double eval(){ return -1.0;} public String toString(){return "x";}};	
		
		
		 public abstract double eval();
		 public abstract String toString();
	}

//	/**
//	 * @author meeusen
//	 *
//	 */
//	public enum Operator 
//	{
//		PLUS  		{ public char eval() { return '+'; } },
//		MINUS 		{ public char eval() { return '-'; } },
//		DIVIDE 		{ public char eval() { return '/'; } },
//		MULTIPLY 	{ public char eval() { return '*'; } };
//	
//		public abstract char eval();
//	}
	
//	saving this for later, maybe we will go with this version of Operator later
	public enum Operator 
	{
		PLUS  		{ public double eval(double x, double y) { return x + y; }  public String toString(){return "+"; }},
		MINUS 		{ public double eval(double x, double y) { return x - y; }  public String toString(){return "-";}},
		DIVIDE 		{ public double eval(double x, double y) { return x / y; }  public String toString(){return "/"; }},
		MULTIPLY 	{ public double eval(double x, double y) { return x * y; }  public String toString(){return "*";}};
	
		public abstract double eval(double x, double y);
		public abstract String toString();
	};
	
	

};
